Skip to content

fix: rollback plan shows new fleet IPs instead of old fleet - #945

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
CSTRSK:fix/rollback-plan-old-ips
Aug 9, 2026
Merged

fix: rollback plan shows new fleet IPs instead of old fleet#945
ralyodio merged 1 commit into
profullstack:masterfrom
CSTRSK:fix/rollback-plan-old-ips

Conversation

@CSTRSK

@CSTRSK CSTRSK commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Bug

In sh1pt scale rollout --rollback <id>, the rollback plan displayed oldIps by filtering the fleet against target.newInstanceIds:

const oldIps = fleet.instances
  .filter(i => target.newInstanceIds.includes(i.id))   // BUG: filters NEW ids
  .map(i => i.publicIp || i.privateIp || '?.?.?.?');

The plan therefore showed the IPs of the new instances being torn down, while the actual rollback action (lines below) correctly reactivates target.oldInstanceIds for blue-green. The displayed IPs list contradicted what the command did.

Fix

Extract a tested rollbackPlanIps() helper that filters against target.oldInstanceIds, and use it in the rollback plan. Adds regression tests for publicIp, privateIp fallback, and the missing-IP placeholder.

Verification

  • pnpm vitest run packages/cli/src/commands/scale.test.ts → 53 tests passed (3 new)
  • Typecheck: only pre-existing errors in build-actions.ts/ship.ts (missing built workspace packages), unchanged by this PR

In 'sh1pt scale rollout --rollback <id>', the rollback plan computed
'oldIps' by filtering fleet instances against target.newInstanceIds,
so the displayed IPs were the NEW instances being torn down rather
than the OLD fleet being restored. The actual rollback action
correctly reactivates target.oldInstanceIds (blue-green), so the plan
output contradicted what the command did.

Extract rollbackPlanIps() which filters against oldInstanceIds and
add regression tests covering publicIp, privateIp fallback and the
missing-IP placeholder.
@CSTRSK

CSTRSK commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Submitted to ugig.net bounty (c3137a9d) — bug fix PR for sh1pt.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: git fetch upstream master && git rebase upstream/master.

@ralyodio
ralyodio merged commit 214c3b8 into profullstack:master Aug 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants